// Copyright 2017 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "sass:map";

.docs-prop-details code {
  /* stylelint-disable declaration-no-important */
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important;
  font-size: small;
  font-weight: 600;
  padding: 0;
  /* stylelint-enable declaration-no-important */
}

.docs-prop-default {
  font-weight: 400;

  &:empty {
    display: none;
  }

  &::before {
    content: "=";
    display: inline-block;
    margin: 0 $pt-spacing;
  }
}

.docs-prop-description {
  margin-top: $pt-spacing;

  p:last-child {
    margin: 0;
  }
}

.docs-prop-tags {
  &:empty {
    display: none;
  }

  .#{$ns}-tag {
    margin-right: $pt-spacing * 2;
    margin-top: $pt-spacing;
  }
}

.docs-prop-name code::after {
  @include pt-icon;
  line-height: small;
  margin-left: $pt-spacing;
  vertical-align: middle;
}

.docs-prop-is-deprecated code {
  color: $red3;

  &::after {
    content: map.get($blueprint-icon-codepoints, "small-cross");
  }
}

.docs-prop-is-required code {
  color: $green3;

  .#{$ns}-dark & {
    color: $green4;
  }

  &::after {
    content: map.get($blueprint-icon-codepoints, "small-tick");
  }
}

.docs-interface-header {
  align-items: center;
  box-shadow: 0 1px 0 $pt-divider-black;
  display: flex;
  font-family: $pt-font-family-monospace;
  font-size: $pt-font-size-large;
  font-weight: 600;
  justify-content: space-between;
  padding: ($pt-spacing * 2) 0;
  position: relative;

  // optional interface description
  + .docs-section {
    box-shadow: 0 1px 0 $pt-divider-black;
    display: flex;
    flex-direction: column;
    margin-top: $pt-spacing * 2;
  }

  .#{$ns}-dark & {
    box-shadow: 0 1px 0 $pt-dark-divider-white;

    + .docs-section {
      box-shadow: 0 1px 0 $pt-dark-divider-white;
    }
  }
}

.docs-package-name {
  // adjusts text baseline with interface name
  margin-top: $pt-font-size-large - $pt-font-size;
}

.docs-type-alias {
  overflow: auto;
  padding: ($pt-spacing * 2) ($pt-spacing * 5);
}

.docs-modifiers-table {
  .docs-section & .#{$ns}-html-table {
    margin-top: $pt-spacing * 2;
  }

  th:first-child,
  td:first-child {
    padding-left: 0;
  }

  tr:last-child td {
    padding-bottom: 0;
  }
}

// modifiers table parent
.docs-modifiers {
  margin-bottom: $heading-margin;
  margin-top: $heading-margin * 0.5;
}
